# Copyright (c) 2017 Presto Labs Pte. Ltd.
# Author: jaewon

import time
import unittest

from coin.base.timestamp import get_timestamp


class TimestampTest(unittest.TestCase):
  def test_get_timestamp(self):
    t1 = get_timestamp()
    t2 = int(time.time() * 10**6) * 1000
    self.assertLess(abs(t2 - t1), 5000)  # 5 us


if __name__ == "__main__":
  unittest.main()
